package com.example.xd.defaultcall.net;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

/**
 * @auther XuDan on 2020/6/11.
 * 用注解的方式完成网络请求
 * Retrofit:发送网络请求(api封装)
 * RXJava:处理回来的消息
 * okHttp:网络模块()
 * http请求:1.0---->默认短连接
 *         1.1---->默认长连接
 *     属于半双工协议
 *  Header+Body
 */
public class NetManager {
    private static final NetManager ourInstance = new NetManager();

    public static NetManager getInstance() {
        return ourInstance;
    }

    private NetManager() {
    }

    public File downLoadFile(String file_url) {
        try {
            URL url = new URL(file_url);
            URLConnection connection = url.openConnection();
            connection.setReadTimeout(8000);
            connection.setReadTimeout(8000);
            InputStream inputStream = connection.getInputStream();


        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;

    }
}
